﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VSSTQH
{
    public partial class FrmDatabase : Form
    {
        public bool IsWindowMode
        {
            get { return rdoWindowMode.Checked; }
        }

        public string Server
        {
            get { return edtServer.Text; }
        }

        public string Database
        {
            get { return edtDatabase.Text; }
        }

        public string Username
        {
            get { return edtUsername.Text; }
        }

        public string Password
        {
            get { return edtPassword.Text; }
        }

        public FrmDatabase()
        {
            InitializeComponent();

            btnOK.Click += new EventHandler(delegate
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            });

            btnExit.Click += new EventHandler(delegate {
                Application.Exit();
            });

            this.rdoWindowMode.CheckedChanged += new EventHandler(CheckedChanged);
            this.rdoSQLMode.CheckedChanged += new EventHandler(CheckedChanged);
        }

        void CheckedChanged(object sender, EventArgs e)
        {
            if (this.rdoWindowMode.Checked)
            {
                this.uiGroupBox1.Enabled = false;
            }
            else
            {
                this.uiGroupBox1.Enabled = true;
            }
        }

        protected override void OnLoad(EventArgs e)
        {
            edtDatabase.Text = "VSS-TQH";
           edtServer.Text = Environment.UserDomainName + "\\SQLEXPRESS";
        }


    }
}
